package com.controller;

import com.alibaba.fastjson.JSON;
import com.entity.TPayVoucher;
import com.entity.vo.Voucher_write_off_Vo;
import com.service.VocherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class Vo_Controller {
    @Autowired
    private VocherService vocherService;

    @RequestMapping(value = "/time", produces = {"application/json;charset=UTF-8"})
    public String index(@RequestBody Map<String, String> map) {
//        初始化时间

        List<Voucher_write_off_Vo> tPayVoucher = vocherService.Voucher_write_off(map);
        return JSON.toJSONString(tPayVoucher);
    }

}
